cmake_minimum_required(VERSION 3.5.1)



add_library(control_gflags control_gflags.cc)
target_link_libraries(control_gflags gtest  ${gflags_LIBRARIES})



add_library(hysteresis_filter hysteresis_filter.cc)
target_link_libraries(hysteresis_filter )




add_library(interpolation_1d interpolation_1d.cc)
target_link_libraries(interpolation_1d cyber  Eigen3::Eigen)




add_library(interpolation_2d interpolation_2d.cc)
target_link_libraries(interpolation_2d cyber  Eigen3::Eigen)






add_library(leadlag_controller leadlag_controller.cc)
target_link_libraries(leadlag_controller cyber  control_proto)



add_library(pid_controller pid_controller.cc)
target_link_libraries(pid_controller cyber  control_proto)


add_library(pid_BC_controller pid_BC_controller.cc)
target_link_libraries(pid_BC_controller cyber  control_proto common::math pid_controller)




add_library(pid_IC_controller pid_IC_controller.cc)
target_link_libraries(pid_IC_controller  cyber  control_proto common::math pid_controller)









add_library(trajectory_analyzer trajectory_analyzer.cc)
target_link_libraries(trajectory_analyzer control_gflags cyber 
                        common::proto
                        common_vehicle_model
                         common::math pid_controller
                         planning_proto)


add_library(control_common)
target_link_libraries(control_common

        control_gflags
        hysteresis_filter
        interpolation_1d
        interpolation_2d
        leadlag_controller
        pid_controller
        trajectory_analyzer
)



install(TARGETS control_common
        control_gflags
        hysteresis_filter
        interpolation_1d
        interpolation_2d
        leadlag_controller
        pid_controller
        trajectory_analyzer
            EXPORT apollo-export
            LIBRARY DESTINATION lib
            ARCHIVE DESTINATION lib
            RUNTIME DESTINATION bin
            INCLUDES DESTINATION .
        )


                                            